package com.coincalf.feign;

import com.coincalf.feign.hystrix.AccountServiceClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Description: 资金账户服务
 * @Author: Chen Long
 * @Date: Created in 2018/5/21 下午8:12
 * @Modified by: Chen Long
 */
@FeignClient(value = "coincalf-service", fallback = AccountServiceClientFallback.class)//fallback的作用是调用不通的时候进行转跳
public interface AccountServiceClient {

    /**
     * 充币到账
     *
     * @return
     */
    @RequestMapping(value = "/account/recharge", method = RequestMethod.POST)
    void recharge();

    /**
     * 初始化用户资金账户和外汇账户 仅注册的时候调用
     *
     * @param userId
     * @return
     */
    @RequestMapping(value = "/account/syncAccount", method = RequestMethod.POST)
    boolean syncAccount(@RequestParam("userId") long userId);

}
